package br.mestrado.unb.bs.model.sensor;

import br.mestrado.unb.bs.model.constant.DataPackageConstant;

public class Spo2Payload  extends Payload implements Spo2PayloadInterface {


	
	
	byte lowOxygenation;
	byte highOxygenation;

	byte lowPulseRate;
	byte highPulseRate;
	
	public byte[] toByteStream(){
		byte[] stream = new byte[getSize()];
		stream[0] = lowOxygenation;
		stream[1] = highOxygenation;
		stream[2] = lowPulseRate;
		stream[3] = highPulseRate;
		return stream;
	}
	@Override
	public byte getSize() {
		return DataPackageConstant.spo2_payload_size;
	}
	@Override
	public byte getCategory() {
		return DataPackageConstant.spo2_category;
	}
	public byte getLowOxygenation() {
		return lowOxygenation;
	}
	public void setLowOxygenation(byte lowOxygenation) {
		this.lowOxygenation = lowOxygenation;
	}
	public byte getHighOxygenation() {
		return highOxygenation;
	}
	public void setHighOxygenation(byte highPercentage) {
		this.highOxygenation = highPercentage;
	}
	public byte getLowPulseRate() {
		return lowPulseRate;
	}
	public void setLowPulseRate(byte lowPulseRate) {
		this.lowPulseRate = lowPulseRate;
	}
	public byte getHighPulseRate() {
		return highPulseRate;
	}
	public void setHighPulseRate(byte highPulseRate) {
		this.highPulseRate = highPulseRate;
	}
	@Override
	public String toString() {
		return "Spo2 [HO=" + highOxygenation
				+ ", LO=" + lowOxygenation + ", HPR="
				+ highPulseRate + ", LPR=" + lowPulseRate + "]";
	}
	
	
	
}
